<template>
	<view class="container-wallet" style="background: url(/static/vnode/bgc.png) no-repeat; background-size: 100%">
		<view class="main">
			<view class="item flex" v-for="(item,index) in month" :key="index">
				<view class="lt">
					<image style="width: 72rpx;height: 72rpx;"  :src="$fun.imgUrl(item.image)" mode="widthFix"></image>
				</view>
				<view class="rt flex-between">
					<view class="left">
						<view class="name">
							{{item.name}}
						</view>
						<view class="money">
							{{item.money}}
						</view>
					</view>
					<view class="right">
						<view class="flex" style="">
							<view class="mintitle" v-if="item.transfer==1"
								@click="onDetali(`/pageA/wallet/transfer?id=${item.id}&name=${item.name}`)">{{$t('wallet.name1')}}</view>
							<view class="mintitle" v-if="item.convert == 1"
								@click="onDetali( `/pageA/wallet/legumes?id=${item.id}&name=${item.name}`)">{{$t('wallet.name2')}}</view>
							<view class="mintitle" v-if="item.recharge==1"
								@click="onDetali(`/pageA/wallet/rechargeCoins?id=${item.id}`)">
								{{$t('wallet.name3')}}</view>
							<view class="mintitle Withdrawal" v-if="item.withdrawal==1"
								@click="onDetali( `/pageA/wallet/withdrawalCoins?id=${item.id}`)">{{$t('wallet.name4')}}</view>
						</view>
						<view class="more"
							@click="onDetali(`/pageA/wallet/balanceList?id=${item.id}&name=${item.name}`)">
							{{$t('wallet.name5')}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				month: {
					money: '--',
					balance: '--',
					charges: '--',
					point: '--',
					score: '--',
					shopping: '--',
				}
			}
		},
		onShow() {
			this.init()
		},
		onLoad() {
			uni.setNavigationBarTitle({
				title:this.$t('wallet.name6')
			})
		},
		methods: {
			// 初始化
			init() {
				this.getList()
			},
			// 获取数据
			getList() {
				this.$fun.ajax.post('user/balance', {}).then(res => {
					this.month = res.data
				})
			},
			// 查看详情
			onDetali(url) {
				this.$fun.jump(url)
			},
		}
	}
</script>

<style lang="scss">
	page {
		// height: 100%;
		height: 100%;
	}

	.container-wallet {
		// position: relative;
		height: 100%;

		// .bgc {
		// 	height: 100%;
		// }

		.main {
			height: 100%;
			padding: 0 20rpx;
			padding-top: 20rpx;

			.item {
				height: 190rpx;
				background-color: rgba(33, 36, 47, 0.5);
				border: 1rpx solid #b5b5b5;
				border-radius: 20rpx;
				margin: 20rpx 0;
				padding: 20rpx;

				.lt {
					width: 76rpx;
					height: 76rpx;
				}

				.rt {
					flex: 1;
					margin-left: 20rpx;

					.left {
						text-align: cen;

						.name {
							font-family: PingFang SC, PingFang SC;
							font-weight: bold;
							font-size: 32rpx;
							color: #FFFFFF;
							line-height: 38rpx;
						}

						.money {
							font-family: DIN, DIN;
							font-weight: bold;
							font-size: 48rpx;
							color: #00A3FF;
							line-height: 86rpx;
							text-align: left;
							font-style: normal;
							text-transform: none;
						}
					}

					.right {
						.mintitle{
							width: 110rpx;
							height: 44rpx;
							border: 1rpx solid #00A3FF;
							border-radius: 30rpx;
							text-align: center;
							line-height: 40rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: bold;
							font-size: 24rpx;
							color: #00A3FF;
							margin: 0 10rpx;
						}
						.Withdrawal{
							background-color: #00A3FF;
							color: #fff;
						}
						.more{
							// width: 186rpx;
							color: #fff;
							text-align: right;
							font-size: 24rpx;
							margin: 30rpx 20rpx;
						}
					}
				}
			}
		}
	}


	.wallet-list {
		width: 700upx;
		margin: 25upx auto;
		background: rgba(42, 48, 62, 0.7);
		border-radius: 10upx;
		padding: 39upx 39upx 45upx 39upx;
		box-sizing: border-box;

		.top {
			display: flex;
			justify-content: space-between;

			.title {
				color: $border-color-dark;
				font-size: 26upx;
			}

			.right {
				display: flex;

				.mintitle {
					color: $border-color-dark;
					margin-left: 35upx;
					font-size: 26upx;

					&:nth-child(1) {
						margin-left: 0;
					}
				}
			}
		}

		.bottom {
			display: flex;
			justify-content: space-between;
			margin-top: 40upx;

			.num {
				color: #1E84F1;
				font-size: 46upx;
			}

			.more {
				color: $border-color-dark;
				font-size: 26upx;
				margin-top: 20upx;
			}
		}
	}
</style>